package GUI;
import processing.core.*;

public class Component
{
    public int x;
    public int y;
    public int width;
    public int height;
    public int style;
    public int backColor;
    public int alpha;
  
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    public Component()
    {
    	backColor = Utils.globalProcessing.color(180, 180, 255,40);
    }
  
    public void draw()
    {
    		Utils.globalProcessing.rectMode(Utils.globalProcessing.CORNER);
        	Utils.globalProcessing.noStroke();
        	Utils.globalProcessing.fill(backColor);
            Utils.globalProcessing.rect(x, y, width, height);
            
            Utils.globalProcessing.strokeWeight(1);
            Utils.globalProcessing.stroke(Utils.globalProcessing.color(255, 255, 255), 255);
            Utils.globalProcessing.line(x, y - 0, x + width, y - 0);
            Utils.globalProcessing.line(x, y + height + 0, x + width, y + height + 0);
            Utils.globalProcessing.line(x - 0, y, x - 0, y + height);
            Utils.globalProcessing.line(x + width + 0, y, x + width + 0, y + height);
            
            
            Utils.globalProcessing.strokeWeight(1);
            Utils.globalProcessing.stroke(Utils.globalProcessing.color(0, 0, 0), 180);
            Utils.globalProcessing.line(x, y - 1, x + width, y - 1);
            Utils.globalProcessing.line(x, y + height + 1, x + width, y + height + 1);
            Utils.globalProcessing.line(x - 1, y, x - 1, y + height);
            Utils.globalProcessing.line(x + width + 1, y, x + width + 1, y + height);


    }
  
  public boolean mouseOver()
  {
    if(Utils.globalProcessing.mouseX > x && Utils.globalProcessing.mouseX < x + width && 
    		Utils.globalProcessing.mouseY > y && Utils.globalProcessing.mouseY < y + height) return true;
      return false;
  }
  
}
